package 练习;

//获取数组的最大值

public class test01 {
    public static void main(String[] args) {
        int [] arr = {12,23,87,6,49,11};

        int max = getmax(arr);
        System.out.println(max );
        
    }
    public static int getmax(int[] arr){
        int max = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if(max<arr[i]){
                max =arr[i];
            }
        }
        return max;
    }
}
